using System;
using System.Collections.Generic;
using System.Text;

namespace Tortuga.Core.TortoiseCommands {
	/// <summary>
	/// Brings up the registered Diff Viewer for the two paths specified.
	/// "If the option /path2  is set, then the diff program is started with those two files. 
	/// If /path2 is ommitted, then the diff is done between the file in /path and its BASE."
	/// - TortoiseSVN docs: Appendix C :: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/apc.html
	/// </summary>
	public class DiffCommand : SinglePathTortoiseCommand {
		private string _path2 = "";

		private DiffCommand()
			: this("") {
		}

		public DiffCommand(string path) : this(path, "") { }

		public DiffCommand(string path, string path2)
			: base("diff", path) {
			this.Path2 = path2;
			this.OptionsToBuild = new List<BuildOptionDelegate>(new BuildOptionDelegate[] {
				this.BuildPathOption,
				this.BuildPath2Option,
				this.BuildNoTempFile,
				this.BuildCloseOnEnd
			});
		}

		public string BuildPath2Option() {
			return BuildOption("path2", Path2);
		}

		/// <summary>
		/// "If the option /path2  is set, then the diff program is started with those two files. 
		/// If /path2 is ommitted, then the diff is done between the file in /path and its BASE."
		/// - TortoiseSVN docs: Appendix C :: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/apc.html
		/// </summary>
		public string Path2 {
			get { return _path2; }
			set { _path2 = value; }
		}
	}
}
